// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import store from './store'
import router from './router'
import fastClick from 'fastclick'
import './assets/styles/reset.css'
import './assets/styles/border.css'
import '@/assets/styles/common.css'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import Cookies from 'js-cookie'
import VueAMap from 'vue-amap'
import { lazyAMapApiLoaderInstance } from 'vue-amap'
// swiper轮播图
import VueAwesomeSwiper from 'vue-awesome-swiper'
import 'swiper/dist/css/swiper.css'

import 'lib-flexible/flexible'
// iconfont
import '@/assets/styles/iconfont/iconfont.css'
Vue.use(VueAMap)
VueAMap.initAMapApiLoader({
  key: '9132fb86be1e7fda04488c4c673defd5',
  plugin: ['AMap.Autocomplete', // 输入提示插件
    'AMap.PlaceSearch', // POI搜索插件
    'AMap.Scale', // 右下角缩略图插件 比例尺
    'AMap.OverView', // 地图鹰眼插件
    'AMap.ToolBar', // 地图工具条
    'AMap.MapType', // 类别切换控件，实现默认图层与卫星图、实施交通图层之间切换的控制
    'AMap.PolyEditor', // 编辑 折线多，边形
    'AMap.CircleEditor', // 圆形编辑器插件
    'AMap.Geolocation' // 定位控件，用来获取和展示用户主机所在的经纬度位置
  ], // 圆形编辑器插件
  // 默认高德 sdk 版本为 1.4.4
  v: '1.4.4'
})
// setTimeout(() => {
//   localStorage.removeItem('_AMap_raster')
//   Vue.use(VueAMap)
// }, 0)
lazyAMapApiLoaderInstance.load().then(() => {
  localStorage.removeItem('_AMap_raster')
  Vue.use(VueAMap)
})
Vue.prototype.$baseUrl = process.env.baseUrl
Vue.config.productionTip = false
Vue.use(ElementUI, {
  size: Cookies.get('size') || 'medium' // set element-ui default size
})
fastClick.attach(document.body)
Vue.use(VueAwesomeSwiper)
Vue.use(ElementUI)
/* eslint-disable no-new */
// 引入mock数据，关闭则注释该行
require('../mock')

new Vue({
  el: '#app',
  router,
  store,
  // components: { App },
  render: h => h(App)
})
